<?xml version="1.0" encoding="ISO-8859-1" ?>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
  
<!-- include moo talk header file -->
<%@ include file="MooTalkHeader.jsp" %>
<%@page import="com.webapp.model.User, java.util.List" %>
<% 
	User testUser = (User)session.getAttribute("UserEdit");
%>
		<div id="site_content_text">
			<h2>Information for <%=testUser.getUserId()%> created on <%=testUser.getCreationDate()%></h2>
			
			<br/>
			<h3><%=testUser.getFirstName()%> <%=testUser.getLastName()%></h3>
			<% 
				String x = request.getParameter("user"); 
				if(x != null) {
					if(x.equals("removed")) {
						%>
							<p style="color:red;">
								Invalid Login!
							</p>
						<%
					}
					
					if(x.equals("updated")) {
						%>
							<p style="color:red;">
								Logout successful! Please have a great day!
							</p>
						<%
					}
				}
			%>
			<form action="UpdateUser.do" method="post">
				<table>
				
					<tr>
						<td>First Name: <br/> <input type="text" name="FIRSTNAME" value="<%=testUser.getFirstName()%>"/></td>
					</tr>
					<tr>
						<td>Last Name:<br/> <input type="text" name="LASTNAME" value="<%=testUser.getLastName()%>"/></td>
					</tr>
					<tr>
						<td>SSN:<br/> <input type="text" name="SSN" value="<%=testUser.getSSN()%>"/></td>
					</tr>
					<tr>
						<td>Rating:<br/> <input type="text" name="RATING" value="<%=testUser.getRating()%>"/></td>
					</tr>
					<tr>
						<td>ID:<br/> <input type="text" name="ID" value="<%=testUser.getUserId()%>"/></td>
					</tr>
					<tr>
						<td>Password: <br/> <input type="text" name="PASSWORD" value="<%=testUser.getPassword()%>"/></td>
					</tr>
					<tr>
						<td>Address:<br/> <input type="text" name="ADDRESS" value="<%=testUser.getAddress()%>"/> </td>
					</tr>
					<tr>
						<td> City:<br/> <input type="text" name="CITY" value="<%=testUser.getCity()%>"/> </td>
					</tr>
					<tr>
						<td> State:<br/> <input type="text" name="State" value="<%=testUser.getState()%>"/> </td>
					</tr>
					<tr>
						<td> Zip:<br/> <input type="text" name="ZIP" value="<%=testUser.getZip()%>"/> </td>
					</tr>
					<tr>
						<td> Email:<br/> <input type="text" name="EMAIL" value="<%=testUser.getEmail()%>"/> </td>
					</tr>
					<tr>
						<td>  <input type="submit" value="Update Customer"/> </td>
					</tr>
				</table>
			</form>
			<form action="DeleteUser.do" method="post">
				<table>
					<tr>
						<td><input type="hidden" name="ID" value="<%=testUser.getSSN()%>"/></td>
					</tr>
					<tr>
						<td><input class="btn" type="submit" value="Delete User" onclick=""/></td>
					</tr>
				</table>
			</form> 
		</div>
		
<!--  include moo talk footer file -->
<%@ include file="MooTalkFooter.jsp" %>